package com.kadron.order;

import java.io.Serializable;
import java.math.BigDecimal;

public class OrderItemPrice implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8134979469078957246L;
	
	private long itemId;
	private String currencyCode;
	private BigDecimal price;
	private BigDecimal discountPrice;
	private BigDecimal yourPrice;

	private OrderItemPrice() {
		super();
	}

	public OrderItemPrice(long itemId) {
		this();
		this.itemId = itemId;
	}

	public OrderItemPrice(long itemId, String currencyCode, BigDecimal price) {
		this(itemId);
		this.currencyCode = currencyCode;
		this.price = price;
	}

	public long getItemId() {
		return itemId;
	}

	public void setItemId(long itemId) {
		this.itemId = itemId;
	}

	public String getCurrencyCode() {
		return currencyCode;
	}

	public void setCurrencyCode(String currencyCode) {
		this.currencyCode = currencyCode;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public BigDecimal getDiscountPrice() {
		return discountPrice;
	}

	public void setDiscountPrice(BigDecimal discountPrice) {
		this.discountPrice = discountPrice;
	}

	public BigDecimal getYourPrice() {
		return yourPrice;
	}

	public void setYourPrice(BigDecimal yourPrice) {
		this.yourPrice = yourPrice;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((currencyCode == null) ? 0 : currencyCode.hashCode());
		result = prime * result + (int) (itemId ^ (itemId >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OrderItemPrice other = (OrderItemPrice) obj;
		if (currencyCode == null) {
			if (other.currencyCode != null)
				return false;
		} else if (!currencyCode.equals(other.currencyCode))
			return false;
		if (itemId != other.itemId)
			return false;
		return true;
	}

}
